Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Chambers 621 posts 1203 karma points c-trib
    Sep 26, 2013 @ 13:10
    Mike Chambers
    0

    {record.IP} on cloud host with multinode and loadbalancing...

    So at present because of the multinode/loadbalanced setup of my host, all the log entries in the contour admin screens are showing as coming from the same IP, the ip of the external interface on the load balancer.

    My host provides a header for the client ip.. 

    In order for this to be correctly logged as the record.IP do I need to add something like this into my custom workflows?

     

    public override WorkflowExecutionStatus Execute(Umbraco.Forms.Core.Record record, Umbraco.Forms.Core.RecordEventArgs e)
            {
                try
                {
                    record.IP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_CLUSTER_CLIENT_IP"];
                    RecordStorage rs = new RecordStorage();
                    rs.UpdateRecord(record, e.Form);
                    rs.Dispose();
                }
                catch { }
            }
    

    Or is there an easier way to override the defaulte REMOTE_ADDR that I presume the ip logger is using?

     

    Thanks for any help

    Mike

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 26, 2013 @ 14:57
    Tim Geyssens
    1

    Nope that would be it

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies